/*
 * @Author: jack-ZM
 * @Date: 2022-08-04 19:10:37
 * @LastEditors: jack-ZM
 * @LastEditTime: 2022-10-20 10:12:05
 * @FilePath: /vite-admin-template/src/router/index.ts
 * @Description:   路由表
 * Copyright (c) 2022 by zsm smzhang@fiberhome.com, All Rights Reserved.
 */
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import constantModules from './constantModules/index';
/* 通过检索 views 文件夹可自动生成路由，并支持动态路由  */
// import routes from 'virtual:generated-pages';
const routes: Array<RouteRecordRaw> = [
    {
        path: '',
        redirect: '/login'
    },
    ...constantModules
];
//404
export const notFound = {
    path: '/:catchAll(.*)',
    name: 'notFound',
    component: () => import(/* webpackChunkName: "404" */ '@/views/user-manager/notFound/404.vue')
};
const router = createRouter({
    history: createWebHistory(),
    routes
});
export function resetRouter() {
    const newRouter = router;
    (router as any).matcher = (newRouter as any).matcher; // reset router
}
export default router;
